home *** CD-ROM | disk | FTP | other *** search
/ Apple Developer Connection 1998 Fall: Game Toolkit / Disc.iso / SDKs / QuickTime Mac / PInterfaces / QD3DCamera.p < prev    next >
Encoding:
Text File  |  1998-04-09  |  9.9 KB  |  230 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        QD3DCamera.p
  3.  
  4.      Contains:    Generic camera routines                                             
  5.  
  6.      Version:    Technology:    Quickdraw 3D 1.5.4
  7.                  Release:    QuickTime 3.0
  8.  
  9.      Copyright:    © 1995-1998 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT QD3DCamera;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __QD3DCAMERA__}
  28. {$SETC __QD3DCAMERA__ := 1}
  29.  
  30. {$I+}
  31. {$SETC QD3DCameraIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __QD3D__}
  35. {$I QD3D.p}
  36. {$ENDC}
  37.  
  38.  
  39. {$PUSH}
  40. {$ALIGN POWER}
  41. {$LibExport+}
  42.  
  43. {*****************************************************************************
  44.  **                                                                             **
  45.  **                            Data Structure Definitions                         **
  46.  **                                                                             **
  47.  ****************************************************************************}
  48. {
  49.  *  The placement of the camera.
  50.  }
  51.  
  52. TYPE
  53.     TQ3CameraPlacementPtr = ^TQ3CameraPlacement;
  54.     TQ3CameraPlacement = RECORD
  55.         cameraLocation:            TQ3Point3D;                                {   Location point of the camera      }
  56.         pointOfInterest:        TQ3Point3D;                                {   Point of interest                  }
  57.         upVector:                TQ3Vector3D;                            {   "up" vector                      }
  58.     END;
  59.  
  60. {
  61.  *  The range of the camera.
  62.  }
  63.     TQ3CameraRangePtr = ^TQ3CameraRange;
  64.     TQ3CameraRange = RECORD
  65.         hither:                    Single;                                    {   Hither plane, measured from "from" towards "to"     }
  66.         yon:                    Single;                                    {   Yon  plane, measured from "from" towards "to"      }
  67.     END;
  68.  
  69. {
  70.  *  Viewport specification.  Origin is (-1, 1), and corresponds to the 
  71.  *  upper left-hand corner; width and height maximum is (2.0, 2.0),
  72.  *  corresponding to the lower left-hand corner of the window.  The
  73.  *  TQ3Viewport specifies a part of the viewPlane that gets displayed 
  74.  *    on the window that is to be drawn.
  75.  *  Normally, it is set with an origin of (-1.0, 1.0), and a width and
  76.  *  height of both 2.0, specifying that the entire window is to be
  77.  *  drawn.  If, for example, an exposure event of the window exposed
  78.  *  the right half of the window, you would set the origin to (0, 1),
  79.  *  and the width and height to (1.0) and (2.0), respectively.
  80.  *
  81.  }
  82.     TQ3CameraViewPortPtr = ^TQ3CameraViewPort;
  83.     TQ3CameraViewPort = RECORD
  84.         origin:                    TQ3Point2D;
  85.         width:                    Single;
  86.         height:                    Single;
  87.     END;
  88.  
  89.     TQ3CameraDataPtr = ^TQ3CameraData;
  90.     TQ3CameraData = RECORD
  91.         placement:                TQ3CameraPlacement;
  92.         range:                    TQ3CameraRange;
  93.         viewPort:                TQ3CameraViewPort;
  94.     END;
  95.  
  96. {
  97.  *  An orthographic camera.
  98.  *
  99.  *  The lens characteristics are set with the dimensions of a
  100.  *  rectangular viewPort in the frame of the camera.
  101.  }
  102.     TQ3OrthographicCameraDataPtr = ^TQ3OrthographicCameraData;
  103.     TQ3OrthographicCameraData = RECORD
  104.         cameraData:                TQ3CameraData;
  105.         left:                    Single;
  106.         top:                    Single;
  107.         right:                    Single;
  108.         bottom:                    Single;
  109.     END;
  110.  
  111. {
  112.  *  A perspective camera specified in terms of an arbitrary view plane.
  113.  *
  114.  *  This is most useful when setting the camera to look at a particular
  115.  *  object.  The viewPlane is set to distance from the camera to the object.
  116.  *  The halfWidth is set to half the width of the cross section of the object,
  117.  *  and the halfHeight equal to the halfWidth divided by the aspect ratio
  118.  *  of the viewPort.
  119.  * 
  120.  *  This is the only perspective camera with specifications for off-axis
  121.  *  viewing, which is desirable for scrolling.
  122.  }
  123.     TQ3ViewPlaneCameraDataPtr = ^TQ3ViewPlaneCameraData;
  124.     TQ3ViewPlaneCameraData = RECORD
  125.         cameraData:                TQ3CameraData;
  126.         viewPlane:                Single;
  127.         halfWidthAtViewPlane:    Single;
  128.         halfHeightAtViewPlane:    Single;
  129.         centerXOnViewPlane:        Single;
  130.         centerYOnViewPlane:        Single;
  131.     END;
  132.  
  133. {
  134.  *    A view angle aspect camera is a perspective camera specified in 
  135.  *    terms of the minimum view angle and the aspect ratio of X to Y.
  136.  *
  137.  }
  138.     TQ3ViewAngleAspectCameraDataPtr = ^TQ3ViewAngleAspectCameraData;
  139.     TQ3ViewAngleAspectCameraData = RECORD
  140.         cameraData:                TQ3CameraData;
  141.         fov:                    Single;
  142.         aspectRatioXToY:        Single;
  143.     END;
  144.  
  145. {*****************************************************************************
  146.  **                                                                             **
  147.  **                            Generic Camera routines                             **
  148.  **                                                                             **
  149.  ****************************************************************************}
  150.  
  151. FUNCTION Q3Camera_GetType(camera: TQ3CameraObject): TQ3ObjectType; C;
  152. FUNCTION Q3Camera_SetData(camera: TQ3CameraObject; {CONST}VAR cameraData: TQ3CameraData): TQ3Status; C;
  153. FUNCTION Q3Camera_GetData(camera: TQ3CameraObject; VAR cameraData: TQ3CameraData): TQ3Status; C;
  154. FUNCTION Q3Camera_SetPlacement(camera: TQ3CameraObject; {CONST}VAR placement: TQ3CameraPlacement): TQ3Status; C;
  155. FUNCTION Q3Camera_GetPlacement(camera: TQ3CameraObject; VAR placement: TQ3CameraPlacement): TQ3Status; C;
  156. FUNCTION Q3Camera_SetRange(camera: TQ3CameraObject; {CONST}VAR range: TQ3CameraRange): TQ3Status; C;
  157. FUNCTION Q3Camera_GetRange(camera: TQ3CameraObject; VAR range: TQ3CameraRange): TQ3Status; C;
  158. FUNCTION Q3Camera_SetViewPort(camera: TQ3CameraObject; {CONST}VAR viewPort: TQ3CameraViewPort): TQ3Status; C;
  159. FUNCTION Q3Camera_GetViewPort(camera: TQ3CameraObject; VAR viewPort: TQ3CameraViewPort): TQ3Status; C;
  160. FUNCTION Q3Camera_GetWorldToView(camera: TQ3CameraObject; VAR worldToView: TQ3Matrix4x4): TQ3Status; C;
  161. FUNCTION Q3Camera_GetWorldToFrustum(camera: TQ3CameraObject; VAR worldToFrustum: TQ3Matrix4x4): TQ3Status; C;
  162. FUNCTION Q3Camera_GetViewToFrustum(camera: TQ3CameraObject; VAR viewToFrustum: TQ3Matrix4x4): TQ3Status; C;
  163.  
  164. {*****************************************************************************
  165.  **                                                                             **
  166.  **                            Specific Camera Routines                          **
  167.  **                                                                             **
  168.  ****************************************************************************}
  169. {*****************************************************************************
  170.  **                                                                             **
  171.  **                            Orthographic Camera                                  **
  172.  **                                                                             **
  173.  ****************************************************************************}
  174. FUNCTION Q3OrthographicCamera_New({CONST}VAR orthographicData: TQ3OrthographicCameraData): TQ3CameraObject; C;
  175. FUNCTION Q3OrthographicCamera_GetData(camera: TQ3CameraObject; VAR cameraData: TQ3OrthographicCameraData): TQ3Status; C;
  176. FUNCTION Q3OrthographicCamera_SetData(camera: TQ3CameraObject; {CONST}VAR cameraData: TQ3OrthographicCameraData): TQ3Status; C;
  177. FUNCTION Q3OrthographicCamera_SetLeft(camera: TQ3CameraObject; left: Single): TQ3Status; C;
  178. FUNCTION Q3OrthographicCamera_GetLeft(camera: TQ3CameraObject; VAR left: Single): TQ3Status; C;
  179. FUNCTION Q3OrthographicCamera_SetTop(camera: TQ3CameraObject; top: Single): TQ3Status; C;
  180. FUNCTION Q3OrthographicCamera_GetTop(camera: TQ3CameraObject; VAR top: Single): TQ3Status; C;
  181. FUNCTION Q3OrthographicCamera_SetRight(camera: TQ3CameraObject; right: Single): TQ3Status; C;
  182. FUNCTION Q3OrthographicCamera_GetRight(camera: TQ3CameraObject; VAR right: Single): TQ3Status; C;
  183. FUNCTION Q3OrthographicCamera_SetBottom(camera: TQ3CameraObject; bottom: Single): TQ3Status; C;
  184. FUNCTION Q3OrthographicCamera_GetBottom(camera: TQ3CameraObject; VAR bottom: Single): TQ3Status; C;
  185.  
  186. {*****************************************************************************
  187.  **                                                                             **
  188.  **                            ViewPlane Camera                                  **
  189.  **                                                                             **
  190.  ****************************************************************************}
  191. FUNCTION Q3ViewPlaneCamera_New({CONST}VAR cameraData: TQ3ViewPlaneCameraData): TQ3CameraObject; C;
  192. FUNCTION Q3ViewPlaneCamera_GetData(camera: TQ3CameraObject; VAR cameraData: TQ3ViewPlaneCameraData): TQ3Status; C;
  193. FUNCTION Q3ViewPlaneCamera_SetData(camera: TQ3CameraObject; {CONST}VAR cameraData: TQ3ViewPlaneCameraData): TQ3Status; C;
  194. FUNCTION Q3ViewPlaneCamera_SetViewPlane(camera: TQ3CameraObject; viewPlane: Single): TQ3Status; C;
  195. FUNCTION Q3ViewPlaneCamera_GetViewPlane(camera: TQ3CameraObject; VAR viewPlane: Single): TQ3Status; C;
  196. FUNCTION Q3ViewPlaneCamera_SetHalfWidth(camera: TQ3CameraObject; halfWidthAtViewPlane: Single): TQ3Status; C;
  197. FUNCTION Q3ViewPlaneCamera_GetHalfWidth(camera: TQ3CameraObject; VAR halfWidthAtViewPlane: Single): TQ3Status; C;
  198. FUNCTION Q3ViewPlaneCamera_SetHalfHeight(camera: TQ3CameraObject; halfHeightAtViewPlane: Single): TQ3Status; C;
  199. FUNCTION Q3ViewPlaneCamera_GetHalfHeight(camera: TQ3CameraObject; VAR halfHeightAtViewPlane: Single): TQ3Status; C;
  200. FUNCTION Q3ViewPlaneCamera_SetCenterX(camera: TQ3CameraObject; centerXOnViewPlane: Single): TQ3Status; C;
  201. FUNCTION Q3ViewPlaneCamera_GetCenterX(camera: TQ3CameraObject; VAR centerXOnViewPlane: Single): TQ3Status; C;
  202. FUNCTION Q3ViewPlaneCamera_SetCenterY(camera: TQ3CameraObject; centerYOnViewPlane: Single): TQ3Status; C;
  203. FUNCTION Q3ViewPlaneCamera_GetCenterY(camera: TQ3CameraObject; VAR centerYOnViewPlane: Single): TQ3Status; C;
  204.  
  205. {*****************************************************************************
  206.  **                                                                             **
  207.  **                            View Angle Aspect Camera                          **
  208.  **                                                                             **
  209.  ****************************************************************************}
  210. FUNCTION Q3ViewAngleAspectCamera_New({CONST}VAR cameraData: TQ3ViewAngleAspectCameraData): TQ3CameraObject; C;
  211. FUNCTION Q3ViewAngleAspectCamera_SetData(camera: TQ3CameraObject; {CONST}VAR cameraData: TQ3ViewAngleAspectCameraData): TQ3Status; C;
  212. FUNCTION Q3ViewAngleAspectCamera_GetData(camera: TQ3CameraObject; VAR cameraData: TQ3ViewAngleAspectCameraData): TQ3Status; C;
  213. FUNCTION Q3ViewAngleAspectCamera_SetFOV(camera: TQ3CameraObject; fov: Single): TQ3Status; C;
  214. FUNCTION Q3ViewAngleAspectCamera_GetFOV(camera: TQ3CameraObject; VAR fov: Single): TQ3Status; C;
  215. FUNCTION Q3ViewAngleAspectCamera_SetAspectRatio(camera: TQ3CameraObject; aspectRatioXToY: Single): TQ3Status; C;
  216. FUNCTION Q3ViewAngleAspectCamera_GetAspectRatio(camera: TQ3CameraObject; VAR aspectRatioXToY: Single): TQ3Status; C;
  217.  
  218.  
  219.  
  220. {$ALIGN RESET}
  221. {$POP}
  222.  
  223. {$SETC UsingIncludes := QD3DCameraIncludes}
  224.  
  225. {$ENDC} {__QD3DCAMERA__}
  226.  
  227. {$IFC NOT UsingIncludes}
  228.  END.
  229. {$ENDC}
  230.